<template>
    <!-- 过渡动画 -->
    <transition name="fade">
        <div class="img-view" @click="bigImg">
            <!-- 遮罩层 -->
            <div class="img-layer"></div>
            <div class="img">
                <image class="imgSon" :src="imgSrc"></image>
            </div>
        </div>
    </transition>
</template>
<script>
export default {
  name: 'bigImg',
  props: ['imgSrc'],
  methods: {
    bigImg () {
      // 发送事件
      this.$emit('clickit');
    }
  }
}
</script>
<style scoped>
/*动画*/
.fade-enter-active {
  transition: all .5s linear;
}
.fade-leave-active {
  transition: all .5s linear;
}
/* bigimg */

.img-view {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 750px;
  height: 1400px;
  overflow: hidden;
}

/*遮罩层样式*/
.img-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 750px;
  height: 1400px;
  z-index: 999;
  background-color: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.img{
  width: 750px;
  height: 550px;
  position: absolute;
  left: 0;
  right: 0;
  top: 400px;
}
/*不限制图片大小，实现居中*/
.imgSon {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: block;
  width: 750px;
  height: 550px;
  z-index: 1000;
}
</style>
